//
//  HX_Class.m
//  UI17 - Mail-List
//
//  Created by 韩旭 on 16/8/6.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "HX_Class.h"
#import "MailModel.h"

@implementation HX_Class
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self creatView];
    }
    return self;
}
- (void)setModelMail:(MailModel *)modelMail {
    _modelMail = modelMail;
    _lableName.text = modelMail.name;
    _lableTelephone.text = modelMail.phoneNumber;
    _lableAddress.text = modelMail.gender;
}
- (void)creatView {
    _lableName = [[UILabel alloc] initWithFrame:CGRectZero];
    _lableName.backgroundColor = [UIColor grayColor];
    [self addSubview:_lableName];
    _lableTelephone = [[UILabel alloc] initWithFrame:CGRectZero];
    _lableTelephone.backgroundColor = [UIColor redColor];
    [self addSubview:_lableTelephone];
    _lableAddress = [[UILabel alloc] initWithFrame:CGRectZero];
    _lableAddress.backgroundColor = [UIColor whiteColor];
    [self addSubview:_lableAddress];
}
- (void)layoutSubviews {
    [super layoutSubviews];
    _lableName.frame = CGRectMake(0, 0, kWidth, 100);
    _lableAddress.frame = CGRectMake(0, _lableName.frame.size.height, kWidth, 100);
    _lableTelephone.frame = CGRectMake(0, _lableAddress.frame.size.height + _lableName.frame.size.height, kWidth, 100);
}


@end
